﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace TPCN.Admincp.Controls
{
    public partial class uc_menu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            foreach (Control c in adminnav.Controls)
            {
                if (c is HtmlAnchor)
                {
                    string url = ((HtmlAnchor)c).HRef;
                    if (url == GetCurrentPage())
                    {
                        ((HtmlAnchor)c).Attributes.Add("class", "active");
                    }
                }
            }
        }

        protected string GetCurrentPage()
        {
            string str = "~" + Request.RawUrl;
            return str;
        }
    }
}